package JavaDesign.report_2.t_2;

/**
 * @author zouran
 * createDate：2023/9/27  1:41
 */
public class Shop {
    double totalSales;
    ComputeTotalSales[] goods;

    Shop(ComputeTotalSales[] goods) {
        this.goods = goods;
    }

    public double giveTotalSales() {
        totalSales = 0;
        for (int i = 0; i < goods.length; i++) {
            totalSales = totalSales + goods[i].totalSalesByYear();
        }
        return totalSales;
    }

}
